<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head th:include="common_include :: commonHead('权限编辑')"/>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <form class="form-horizontal m" id="form-right-edit">
                <input type="hidden" name="serverKey" id="serverKey" th:value="${serverKey}"/>
                <div class="form-group">
                    <label class="col-sm-3 control-label">仓库名称：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="repositoryName" id="repositoryName" th:value="${repositoryName}" readonly="true">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label ">仓库条目：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="repositoryPath" id="repositoryPath" th:value="${repositoryPath}" readonly="true"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label ">组别列表：</label>
                    <div class="col-sm-8">
                        <input type="hidden" name="groups" th:value="${groups}">
                        <select multiple="true" class="form-control m-b" disabled="true">
                            <option th:each="group:${allGroups}"
                                    th:value="${group.groupName}"
                                    th:text="${group.groupDesc + '(' + group.groupName + '-' + group.groupDesc + ')'}"
                                    th:selected="${groups == group.groupName}"></option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label ">用户列表：</label>
                    <div class="col-sm-8">
                        <input type="hidden" name="users" th:value="${users}">
                        <select multiple="true" class="form-control m-b" disabled="true">
                            <option th:each="user:${allUsers}"
                                    th:value="${user.username}"
                                    th:text="${user.username + '(' + user.staffNum + '-' + user.staffName + ')'}"
                                    th:selected="${users == user.username}"></option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label ">对象权限：</label>
                    <div class="col-sm-8">
                        <select id="right" name="right" class="form-control m-b"
                                th:with="dicts=${@dictCode.selectDictCodeByType('svnkit_right_type')}">
                            <option th:each="dict:${dicts}" th:text="${dict['codeText']}"
                                    th:value="${dict['codeValue']}" th:selected="${right == dict['codeValue']}"></option>
                        </select>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<div th:include="common_include :: commonFoot"/>
<script type="text/javascript">
    var prefix = ctx + "service/svnkit/repositories"

    $("#form-right-edit").validate({
        submitHandler: function (form) {
            $.operate.save(prefix + "/rightSave", $('#form-right-edit').serialize());
        }
    });

    function submitClick() {
        if ($('#form-right-edit').valid()) {
            $('#form-right-edit').submit()
        }
    }
</script>
</body>
</html>
